var number = 9;

/*全国省份*/
function DoctorProvince() {
    $.ajax({
        url: "findByProvince",
        type: "POST",
        dataType: "json",
        contentType: 'application/json;charset=utf-8',
        success: function (data) {
            if (data.code == 500) {

            } else {
                var str = null;
                for (var i = 0; i < data.ProvinceList.length; i++) {
                    str += "<option value='" + data.ProvinceList[i].provinceID + "'>" + data.ProvinceList[i].provinceName + "</option>";
                }
            }
            $("#Province").append(str);
        }
    });
}

/*全国县区*/
function changeCity() {
    //城市编号
    var cityID = $("#City").val();
    var DataSources = {
        "cityID": cityID
    };
    $.ajax({
        url: "findByCountry",
        type: "POST",
        dataType: "json",
        contentType: 'application/json;charset=utf-8',
        data: JSON.stringify(DataSources),
        success: function (data) {
            if (data.code == 500) {

            } else {
                var str = null;
                for (var i = 0; i < data.CountryList.length; i++) {
                    str += "<option value='" + data.CountryList[i].countryID + "'>" + data.CountryList[i].countryName + "</option>";
                }
            }
            $("#Country").empty();
            $("#Country").append(str);
        }
    });
}

/*全国城市*/
function changeProvince() {
    //省份编号
    var provinceID = $("#Province").val();
    var DataSources = {
        "provinceID": provinceID
    };
    if (provinceID == "0") {
        $("#City").empty();
        $("#Country").empty();
        $("#City").append("<option value='0'>=====请选择城市=====</option>");
        $("#Country").append("<option value='0'>=====请选择县区=====</option>");
    } else {
        $.ajax({
            url: "findByCity",
            type: "POST",
            dataType: "json",
            contentType: 'application/json;charset=utf-8',
            data: JSON.stringify(DataSources),
            success: function (data) {
                if (data.code == 500) {

                } else {
                    var str = null;
                    for (var i = 0; i < data.CityList.length; i++) {
                        str += "<option value='" + data.CityList[i].cityID + "'>" + data.CityList[i].cityName + "</option>";
                    }
                }
                $("#City").empty();
                $("#City").append(str);
                changeCity();
            }
        });
    }
}


//公司初始数据
function loadWebList() {
    startingPage = 0;
    var data = {
        "page": startingPage,
        "number": number
    };
    $.ajax({
        url: "findCompanyByCompanyListAndCompState",
        type: "POST",
        dataType: "json",
        data: JSON.stringify(data),
        contentType: 'application/json;charset=utf-8',
        success: function (data) {
            var code = ' ';
            if (data.code == 500) {
                Swal.fire("提示", "温馨提示：查询此类数据不存在", "error");
            } else {
                for (var i = 0; i < data.company_List.length; i++) {
                    code += "<div class=\"col-xl-4 col-md-6\">\n" +
                        "                                <div class=\"product-grid-view\">\n" +
                        "                                    <div class=\"grid-view-layout3\">\n" +
                        "                                        <div class=\"product-box-layout1 top-rated-grid\">\n" +
                        "                                            <div class=\"item-img\">\n" +
                        "                                                <a href=web-single-plaint.html?id=" + data.company_List[i].compID + " class=\"item-trending\"><img\n" +
                        "                                                    style='width: 275px;height: 195px;' src='upload/" + data.company_List[i].compPhoto + "'   alt=\"Product\"></a>\n" +
                        "                                                <div class=\"bg-color-price\">\n" +
                        "                                                </div>\n" +
                        "                                            </div>\n" +
                        "                                            <div class=\"item-content\">\n" +
                        "                                                <h3 class=\"item-title\"><a href=web-single-plaint.html?id=" + data.company_List[i].compID + ">" + data.company_List[i].compName + "\n" +
                        "                                                    </a><span>New</span></h3>\n" +
                        "                                                <ul class=\"entry-meta\">\n" +
                        "                                                    <li><i class=\"far fa-clock\"></i>" + data.company_List[i].compDate + "</li>\n" +
                        "                                                    <li><i class=\"fas fa-map-marker-alt\"></i>" + data.company_List[i].compAddress + "</li>\n" +
                        "                                                </ul>\n" +
                        "                                                <div class=\"item-action-area\">\n" +
                        "                                                    <div class=\"item-phone\">\n" +
                        "                                                         <a href=\"#\" class=\"classima-phone-reveal not-revealed\"\n" +
                        "                                                           data-phone=\"+886735568743\">\n" +
                        "                                                            <i class=\"fa fa-phone\"></i>\n" +
                        "                                                            <span class=\"number-hidden\">" + data.company_List[i].compPhone + "</span>\n" +
                        "                                                        </a>\n" +
                        "                                                    </div>\n" +
                        "                                                    <div class=\"item-fav\"><a href=\"#\"><i class=\"far fa-heart\"></i></a>\n" +
                        "                                                    </div>\n" +
                        "                                                </div>\n" +
                        "                                            </div>\n" +
                        "                                        </div>\n" +
                        "                                    </div>\n" +
                        "                                </div>\n" +
                        "                                <div class=\"product-list-view\">\n" +
                        "                                    <div class=\"list-view-layout3\">\n" +
                        "                                        <div class=\"product-box-layout3 top-rated-list\">\n" +
                        "                                            <div class=\"item-img\">\n" +
                        "                                                <a href=web-single-plaint.html?id=" + data.company_List[i].compID + " class=\"item-trending\"><img\n" +
                        "                                                     style='width: 275px;height: 195px;'   src='upload/" + data.company_List[i].compPhoto + "' alt=\"Product\"></a>\n" +
                        "                                            </div>\n" +
                        "                                            <div class=\"product-info\">\n" +
                        "                                                <div class=\"item-content\">\n" +
                        "                                                    <div class=\"bg-color-price\">\n" +
                        "                                                    </div>\n" +
                        "                                                    <div class=\"item-category\"><a href=web-single-plaint.html?id=" + data.company_List[i].compID + "></a></div>\n" +
                        "                                                    <h3 class=\"item-title\"><a href=web-single-plaint.html?id=" + data.company_List[i].compID + ">" + data.company_List[i].compName + "\n" +
                        "                                                        </a><span>New</span></h3>\n" +
                        "                                                    <ul class=\"entry-meta\">\n" +
                        "                                                        <li><i class=\"far fa-clock\"></i>" + data.company_List[i].compDate + "</li>\n" +
                        "                                                        <li><i class=\"fas fa-map-marker-alt\"></i>" + data.company_List[i].compAddress + "\n" +
                        "                                                        </li>\n" +
                        "                                                    </ul>\n" +
                        "                                                    <p>" + data.company_List[i].compProfile + ".</p>\n" +
                        "                                                </div>\n" +
                        "                                            </div>\n" +
                        "                                        </div>\n" +
                        "                                    </div>\n" +
                        "                                </div>\n" +
                        "                            </div>";

                }
                $("#loadWebList").html("");
                $("#myProjectTable").html("");
                $("#loadWebList").append(code);
                $("#pageNumber").val(data.count);
                $("#myProjectTable").html("   <div class=\"btn-prev\">\n" +
                    "                            <a onclick='myProjectTable_previous()'><i class=\"fas fa-angle-double-left\"></i>Previous</a>\n" +
                    "                        </div>\n" +
                    "                        <div class=\"page-number\">\n" +
                    "                            <a href=\"#\" class=\"active\">" + (startingPage + 1) + "</a>\n" +
                    "                        </div>\n" +
                    "                        <div class=\"btn-next\">\n" +
                    "                            <a onclick='myProjectTable_next()'>Next<i class=\"fas fa-angle-double-right\"></i></a>\n" +
                    "                        </div>");
            }
        }
    });
}

//初始上一页
function myProjectTable_previous() {
    startingPage = startingPage - 1;
    if (startingPage < 0) {
        startingPage = 0;
        Swal.fire("提示", "数据不存在", "warning");
    } else {
        var data = {
            "page": startingPage * number,
            "number": number
        };
        $.ajax({
            url: "findCompanyByCompanyListAndCompState",
            type: "POST",
            dataType: "json",
            data: JSON.stringify(data),
            contentType: 'application/json;charset=utf-8',
            success: function (data) {
                var code = ' ';
                if (data.code == 500) {
                    Swal.fire("提示", "温馨提示：查询此类数据不存在", "error");
                } else {
                    for (var i = 0; i < data.company_List.length; i++) {
                        code += "<div class=\"col-xl-4 col-md-6\">\n" +
                            "                                <div class=\"product-grid-view\">\n" +
                            "                                    <div class=\"grid-view-layout3\">\n" +
                            "                                        <div class=\"product-box-layout1 top-rated-grid\">\n" +
                            "                                            <div class=\"item-img\">\n" +
                            "                                                <a href=web-single-plaint.html?id=" + data.company_List[i].compID + " class=\"item-trending\"><img\n" +
                            "                                                    style='width: 275px;height: 195px;' src='upload/" + data.company_List[i].compPhoto + "'   alt=\"Product\"></a>\n" +
                            "                                                <div class=\"bg-color-price\">\n" +
                            "                                                </div>\n" +
                            "                                            </div>\n" +
                            "                                            <div class=\"item-content\">\n" +
                            "                                                <h3 class=\"item-title\"><a href=web-single-plaint.html?id=" + data.company_List[i].compID + ">" + data.company_List[i].compName + "\n" +
                            "                                                    </a><span>New</span></h3>\n" +
                            "                                                <ul class=\"entry-meta\">\n" +
                            "                                                    <li><i class=\"far fa-clock\"></i>" + data.company_List[i].compDate + "</li>\n" +
                            "                                                    <li><i class=\"fas fa-map-marker-alt\"></i>" + data.company_List[i].compAddress + "</li>\n" +
                            "                                                </ul>\n" +
                            "                                                <div class=\"item-action-area\">\n" +
                            "                                                    <div class=\"item-phone\">\n" +
                            "                                                         <a href=\"#\" class=\"classima-phone-reveal not-revealed\"\n" +
                            "                                                           data-phone=\"+886735568743\">\n" +
                            "                                                            <i class=\"fa fa-phone\"></i>\n" +
                            "                                                            <span class=\"number-hidden\">" + data.company_List[i].compPhone + "</span>\n" +
                            "                                                        </a>\n" +
                            "                                                    </div>\n" +
                            "                                                    <div class=\"item-fav\"><a href=\"#\"><i class=\"far fa-heart\"></i></a>\n" +
                            "                                                    </div>\n" +
                            "                                                </div>\n" +
                            "                                            </div>\n" +
                            "                                        </div>\n" +
                            "                                    </div>\n" +
                            "                                </div>\n" +
                            "                                <div class=\"product-list-view\">\n" +
                            "                                    <div class=\"list-view-layout3\">\n" +
                            "                                        <div class=\"product-box-layout3 top-rated-list\">\n" +
                            "                                            <div class=\"item-img\">\n" +
                            "                                                <a href=web-single-plaint.html?id=" + data.company_List[i].compID + " class=\"item-trending\"><img\n" +
                            "                                                     style='width: 275px;height: 195px;'   src='upload/" + data.company_List[i].compPhoto + "' alt=\"Product\"></a>\n" +
                            "                                            </div>\n" +
                            "                                            <div class=\"product-info\">\n" +
                            "                                                <div class=\"item-content\">\n" +
                            "                                                    <div class=\"bg-color-price\">\n" +
                            "                                                    </div>\n" +
                            "                                                    <div class=\"item-category\"><a href=web-single-plaint.html?id=" + data.company_List[i].compID + "></a></div>\n" +
                            "                                                    <h3 class=\"item-title\"><a href=web-single-plaint.html?id=" + data.company_List[i].compID + ">" + data.company_List[i].compName + "\n" +
                            "                                                        </a><span>New</span></h3>\n" +
                            "                                                    <ul class=\"entry-meta\">\n" +
                            "                                                        <li><i class=\"far fa-clock\"></i>" + data.company_List[i].compDate + "</li>\n" +
                            "                                                        <li><i class=\"fas fa-map-marker-alt\"></i>" + data.company_List[i].compAddress + "\n" +
                            "                                                        </li>\n" +
                            "                                                    </ul>\n" +
                            "                                                    <p>" + data.company_List[i].compProfile + ".</p>\n" +
                            "                                                </div>\n" +
                            "                                            </div>\n" +
                            "                                        </div>\n" +
                            "                                    </div>\n" +
                            "                                </div>\n" +
                            "                            </div>";

                    }
                    $("#loadWebList").html("");
                    $("#myProjectTable").html("");
                    $("#loadWebList").append(code);
                    $("#pageNumber").val(data.count);
                    $("#myProjectTable").html("   <div class=\"btn-prev\">\n" +
                        "                            <a onclick='myProjectTable_previous()'><i class=\"fas fa-angle-double-left\"></i>Previous</a>\n" +
                        "                        </div>\n" +
                        "                        <div class=\"page-number\">\n" +
                        "                            <a href=\"#\" class=\"active\">" + (startingPage + 1) + "</a>\n" +
                        "                        </div>\n" +
                        "                        <div class=\"btn-next\">\n" +
                        "                            <a onclick='myProjectTable_next()'>Next<i class=\"fas fa-angle-double-right\"></i></a>\n" +
                        "                        </div>");
                }
            }
        });
    }
}

//初始下一页
function myProjectTable_next() {
    startingPage = startingPage + 1;
    var startingPageNumber = startingPage * number;
    var numberSum = $("#pageNumber").val();
    if (startingPageNumber >= numberSum && (startingPageNumber - number) <= numberSum) {
        Swal.fire("提示", "数据浏览已到底", "warning");
    } else {
        var data = {
            "page": startingPageNumber,
            "number": number
        };
        $.ajax({
            url: "findCompanyByCompanyListAndCompState",
            type: "POST",
            dataType: "json",
            data: JSON.stringify(data),
            contentType: 'application/json;charset=utf-8',
            success: function (data) {
                var code = ' ';
                if (data.code == 500) {
                    Swal.fire("提示", "温馨提示：查询此类数据不存在", "error");
                } else {
                    for (var i = 0; i < data.company_List.length; i++) {
                        code += "<div class=\"col-xl-4 col-md-6\">\n" +
                            "                                <div class=\"product-grid-view\">\n" +
                            "                                    <div class=\"grid-view-layout3\">\n" +
                            "                                        <div class=\"product-box-layout1 top-rated-grid\">\n" +
                            "                                            <div class=\"item-img\">\n" +
                            "                                                <a href=web-single-plaint.html?id=" + data.company_List[i].compID + " class=\"item-trending\"><img\n" +
                            "                                                    style='width: 275px;height: 195px;' src='upload/" + data.company_List[i].compPhoto + "'   alt=\"Product\"></a>\n" +
                            "                                                <div class=\"bg-color-price\">\n" +
                            "                                                </div>\n" +
                            "                                            </div>\n" +
                            "                                            <div class=\"item-content\">\n" +
                            "                                                <h3 class=\"item-title\"><a href=web-single-plaint.html?id=" + data.company_List[i].compID + ">" + data.company_List[i].compName + "\n" +
                            "                                                    </a><span>New</span></h3>\n" +
                            "                                                <ul class=\"entry-meta\">\n" +
                            "                                                    <li><i class=\"far fa-clock\"></i>" + data.company_List[i].compDate + "</li>\n" +
                            "                                                    <li><i class=\"fas fa-map-marker-alt\"></i>" + data.company_List[i].compAddress + "</li>\n" +
                            "                                                </ul>\n" +
                            "                                                <div class=\"item-action-area\">\n" +
                            "                                                    <div class=\"item-phone\">\n" +
                            "                                                         <a href=\"#\" class=\"classima-phone-reveal not-revealed\"\n" +
                            "                                                           data-phone=\"+886735568743\">\n" +
                            "                                                            <i class=\"fa fa-phone\"></i>\n" +
                            "                                                            <span class=\"number-hidden\">" + data.company_List[i].compPhone + "</span>\n" +
                            "                                                        </a>\n" +
                            "                                                    </div>\n" +
                            "                                                    <div class=\"item-fav\"><a href=\"#\"><i class=\"far fa-heart\"></i></a>\n" +
                            "                                                    </div>\n" +
                            "                                                </div>\n" +
                            "                                            </div>\n" +
                            "                                        </div>\n" +
                            "                                    </div>\n" +
                            "                                </div>\n" +
                            "                                <div class=\"product-list-view\">\n" +
                            "                                    <div class=\"list-view-layout3\">\n" +
                            "                                        <div class=\"product-box-layout3 top-rated-list\">\n" +
                            "                                            <div class=\"item-img\">\n" +
                            "                                                <a href=web-single-plaint.html?id=" + data.company_List[i].compID + " class=\"item-trending\"><img\n" +
                            "                                                     style='width: 275px;height: 195px;'   src='upload/" + data.company_List[i].compPhoto + "' alt=\"Product\"></a>\n" +
                            "                                            </div>\n" +
                            "                                            <div class=\"product-info\">\n" +
                            "                                                <div class=\"item-content\">\n" +
                            "                                                    <div class=\"bg-color-price\">\n" +
                            "                                                    </div>\n" +
                            "                                                    <div class=\"item-category\"><a href=web-single-plaint.html?id=" + data.company_List[i].compID + "></a></div>\n" +
                            "                                                    <h3 class=\"item-title\"><a href=web-single-plaint.html?id=" + data.company_List[i].compID + ">" + data.company_List[i].compName + "\n" +
                            "                                                        </a><span>New</span></h3>\n" +
                            "                                                    <ul class=\"entry-meta\">\n" +
                            "                                                        <li><i class=\"far fa-clock\"></i>" + data.company_List[i].compDate + "</li>\n" +
                            "                                                        <li><i class=\"fas fa-map-marker-alt\"></i>" + data.company_List[i].compAddress + "\n" +
                            "                                                        </li>\n" +
                            "                                                    </ul>\n" +
                            "                                                    <p>" + data.company_List[i].compProfile + ".</p>\n" +
                            "                                                </div>\n" +
                            "                                            </div>\n" +
                            "                                        </div>\n" +
                            "                                    </div>\n" +
                            "                                </div>\n" +
                            "                            </div>";

                    }
                    $("#loadWebList").html("");
                    $("#myProjectTable").html("");
                    $("#loadWebList").append(code);
                    $("#pageNumber").val(data.count);
                    $("#myProjectTable").html("   <div class=\"btn-prev\">\n" +
                        "                            <a onclick='myProjectTable_previous()'><i class=\"fas fa-angle-double-left\"></i>Previous</a>\n" +
                        "                        </div>\n" +
                        "                        <div class=\"page-number\">\n" +
                        "                            <a href=\"#\" class=\"active\">" + (startingPage + 1) + "</a>\n" +
                        "                        </div>\n" +
                        "                        <div class=\"btn-next\">\n" +
                        "                            <a onclick='myProjectTable_next()'>Next<i class=\"fas fa-angle-double-right\"></i></a>\n" +
                        "                        </div>");
                }
            }
        });
    }
}

//前端分页查询数据 按地址 初始
function changeReProductAddress() {
    //县区编号
    var countryID = $("#Country option:selected").val();
    startingPage = 0;
    var data = {
        "page": startingPage,
        "number": number,
        "countryID": countryID
    };
    $.ajax({
        url: "findCompanyByCompanyListAndCountryID",
        type: "POST",
        dataType: "json",
        data: JSON.stringify(data),
        contentType: 'application/json;charset=utf-8',
        success: function (data) {
            var code = ' ';
            if (data.code == 500) {
                Swal.fire("提示", "温馨提示：查询此类数据不存在", "error");
            } else {
                for (var i = 0; i < data.company_List.length; i++) {
                    code += "<div class=\"col-xl-4 col-md-6\">\n" +
                        "                                <div class=\"product-grid-view\">\n" +
                        "                                    <div class=\"grid-view-layout3\">\n" +
                        "                                        <div class=\"product-box-layout1 top-rated-grid\">\n" +
                        "                                            <div class=\"item-img\">\n" +
                        "                                                <a href=web-single-plaint.html?id=" + data.company_List[i].compID + " class=\"item-trending\"><img\n" +
                        "                                                    style='width: 275px;height: 195px;' src='upload/" + data.company_List[i].compPhoto + "'   alt=\"Product\"></a>\n" +
                        "                                                <div class=\"bg-color-price\">\n" +
                        "                                                </div>\n" +
                        "                                            </div>\n" +
                        "                                            <div class=\"item-content\">\n" +
                        "                                                <h3 class=\"item-title\"><a href=web-single-plaint.html?id=" + data.company_List[i].compID + ">" + data.company_List[i].compName + "\n" +
                        "                                                    </a><span>New</span></h3>\n" +
                        "                                                <ul class=\"entry-meta\">\n" +
                        "                                                    <li><i class=\"far fa-clock\"></i>" + data.company_List[i].compDate + "</li>\n" +
                        "                                                    <li><i class=\"fas fa-map-marker-alt\"></i>" + data.company_List[i].compAddress + "</li>\n" +
                        "                                                </ul>\n" +
                        "                                                <div class=\"item-action-area\">\n" +
                        "                                                    <div class=\"item-phone\">\n" +
                        "                                                         <a href=\"#\" class=\"classima-phone-reveal not-revealed\"\n" +
                        "                                                           data-phone=\"+886735568743\">\n" +
                        "                                                            <i class=\"fa fa-phone\"></i>\n" +
                        "                                                            <span class=\"number-hidden\">" + data.company_List[i].compPhone + "</span>\n" +
                        "                                                        </a>\n" +
                        "                                                    </div>\n" +
                        "                                                    <div class=\"item-fav\"><a href=\"#\"><i class=\"far fa-heart\"></i></a>\n" +
                        "                                                    </div>\n" +
                        "                                                </div>\n" +
                        "                                            </div>\n" +
                        "                                        </div>\n" +
                        "                                    </div>\n" +
                        "                                </div>\n" +
                        "                                <div class=\"product-list-view\">\n" +
                        "                                    <div class=\"list-view-layout3\">\n" +
                        "                                        <div class=\"product-box-layout3 top-rated-list\">\n" +
                        "                                            <div class=\"item-img\">\n" +
                        "                                                <a href=web-single-plaint.html?id=" + data.company_List[i].compID + " class=\"item-trending\"><img\n" +
                        "                                                     style='width: 275px;height: 195px;'   src='upload/" + data.company_List[i].compPhoto + "' alt=\"Product\"></a>\n" +
                        "                                            </div>\n" +
                        "                                            <div class=\"product-info\">\n" +
                        "                                                <div class=\"item-content\">\n" +
                        "                                                    <div class=\"bg-color-price\">\n" +
                        "                                                    </div>\n" +
                        "                                                    <div class=\"item-category\"><a href=web-single-plaint.html?id=" + data.company_List[i].compID + "></a></div>\n" +
                        "                                                    <h3 class=\"item-title\"><a href=web-single-plaint.html?id=" + data.company_List[i].compID + ">" + data.company_List[i].compName + "\n" +
                        "                                                        </a><span>New</span></h3>\n" +
                        "                                                    <ul class=\"entry-meta\">\n" +
                        "                                                        <li><i class=\"far fa-clock\"></i>" + data.company_List[i].compDate + "</li>\n" +
                        "                                                        <li><i class=\"fas fa-map-marker-alt\"></i>" + data.company_List[i].compAddress + "\n" +
                        "                                                        </li>\n" +
                        "                                                    </ul>\n" +
                        "                                                    <p>" + data.company_List[i].compProfile + ".</p>\n" +
                        "                                                </div>\n" +
                        "                                            </div>\n" +
                        "                                        </div>\n" +
                        "                                    </div>\n" +
                        "                                </div>\n" +
                        "                            </div>";

                }
                $("#loadWebList").html("");
                $("#myProjectTable").html("");
                $("#loadWebList").append(code);
                $("#pageNumber").val(data.count);
                $("#myProjectTable").html("   <div class=\"btn-prev\">\n" +
                    "                            <a onclick='myProjectTable_previous_1()'><i class=\"fas fa-angle-double-left\"></i>Previous</a>\n" +
                    "                        </div>\n" +
                    "                        <div class=\"page-number\">\n" +
                    "                            <a href=\"#\" class=\"active\">" + (startingPage + 1) + "</a>\n" +
                    "                        </div>\n" +
                    "                        <div class=\"btn-next\">\n" +
                    "                            <a onclick='myProjectTable_next_1()'>Next<i class=\"fas fa-angle-double-right\"></i></a>\n" +
                    "                        </div>");
            }
        }
    });
}

//前端分页查询数据 按地址 上一页
function myProjectTable_previous_Address(w) {
    //县区编号
    var countryID = $("#Country option:selected").val();
    startingPage = startingPage - 1;
    if (startingPage < 0) {
        startingPage = 0;
        Swal.fire("提示", "数据不存在", "warning");
    } else {
        var data = {
            "page": startingPage * number,
            "number": number,
            "countryID": countryID
        };
        $.ajax({
            url: "findCompanyByCompanyListAndCountryID",
            type: "POST",
            dataType: "json",
            data: JSON.stringify(data),
            contentType: 'application/json;charset=utf-8',
            success: function (data) {
                var code = ' ';
                if (data.code == 500) {
                    Swal.fire("提示", "温馨提示：查询此类数据不存在", "error");
                } else {
                    for (var i = 0; i < data.company_List.length; i++) {
                        code += "<div class=\"col-xl-4 col-md-6\">\n" +
                            "                                <div class=\"product-grid-view\">\n" +
                            "                                    <div class=\"grid-view-layout3\">\n" +
                            "                                        <div class=\"product-box-layout1 top-rated-grid\">\n" +
                            "                                            <div class=\"item-img\">\n" +
                            "                                                <a href=web-single-plaint.html?id=" + data.company_List[i].compID + " class=\"item-trending\"><img\n" +
                            "                                                    style='width: 275px;height: 195px;' src='upload/" + data.company_List[i].compPhoto + "'   alt=\"Product\"></a>\n" +
                            "                                                <div class=\"bg-color-price\">\n" +
                            "                                                </div>\n" +
                            "                                            </div>\n" +
                            "                                            <div class=\"item-content\">\n" +
                            "                                                <h3 class=\"item-title\"><a href=web-single-plaint.html?id=" + data.company_List[i].compID + ">" + data.company_List[i].compName + "\n" +
                            "                                                    </a><span>New</span></h3>\n" +
                            "                                                <ul class=\"entry-meta\">\n" +
                            "                                                    <li><i class=\"far fa-clock\"></i>" + data.company_List[i].compDate + "</li>\n" +
                            "                                                    <li><i class=\"fas fa-map-marker-alt\"></i>" + data.company_List[i].compAddress + "</li>\n" +
                            "                                                </ul>\n" +
                            "                                                <div class=\"item-action-area\">\n" +
                            "                                                    <div class=\"item-phone\">\n" +
                            "                                                         <a href=\"#\" class=\"classima-phone-reveal not-revealed\"\n" +
                            "                                                           data-phone=\"+886735568743\">\n" +
                            "                                                            <i class=\"fa fa-phone\"></i>\n" +
                            "                                                            <span class=\"number-hidden\">" + data.company_List[i].compPhone + "</span>\n" +
                            "                                                        </a>\n" +
                            "                                                    </div>\n" +
                            "                                                    <div class=\"item-fav\"><a href=\"#\"><i class=\"far fa-heart\"></i></a>\n" +
                            "                                                    </div>\n" +
                            "                                                </div>\n" +
                            "                                            </div>\n" +
                            "                                        </div>\n" +
                            "                                    </div>\n" +
                            "                                </div>\n" +
                            "                                <div class=\"product-list-view\">\n" +
                            "                                    <div class=\"list-view-layout3\">\n" +
                            "                                        <div class=\"product-box-layout3 top-rated-list\">\n" +
                            "                                            <div class=\"item-img\">\n" +
                            "                                                <a href=web-single-plaint.html?id=" + data.company_List[i].compID + " class=\"item-trending\"><img\n" +
                            "                                                     style='width: 275px;height: 195px;'   src='upload/" + data.company_List[i].compPhoto + "' alt=\"Product\"></a>\n" +
                            "                                            </div>\n" +
                            "                                            <div class=\"product-info\">\n" +
                            "                                                <div class=\"item-content\">\n" +
                            "                                                    <div class=\"bg-color-price\">\n" +
                            "                                                    </div>\n" +
                            "                                                    <div class=\"item-category\"><a href=web-single-plaint.html?id=" + data.company_List[i].compID + "></a></div>\n" +
                            "                                                    <h3 class=\"item-title\"><a href=web-single-plaint.html?id=" + data.company_List[i].compID + ">" + data.company_List[i].compName + "\n" +
                            "                                                        </a><span>New</span></h3>\n" +
                            "                                                    <ul class=\"entry-meta\">\n" +
                            "                                                        <li><i class=\"far fa-clock\"></i>" + data.company_List[i].compDate + "</li>\n" +
                            "                                                        <li><i class=\"fas fa-map-marker-alt\"></i>" + data.company_List[i].compAddress + "\n" +
                            "                                                        </li>\n" +
                            "                                                    </ul>\n" +
                            "                                                    <p>" + data.company_List[i].compProfile + ".</p>\n" +
                            "                                                </div>\n" +
                            "                                            </div>\n" +
                            "                                        </div>\n" +
                            "                                    </div>\n" +
                            "                                </div>\n" +
                            "                            </div>";

                    }
                    $("#loadWebList").html("");
                    $("#myProjectTable").html("");
                    $("#loadWebList").append(code);
                    $("#pageNumber").val(data.count);
                    $("#myProjectTable").html("   <div class=\"btn-prev\">\n" +
                        "                            <a onclick='myProjectTable_previous_1()'><i class=\"fas fa-angle-double-left\"></i>Previous</a>\n" +
                        "                        </div>\n" +
                        "                        <div class=\"page-number\">\n" +
                        "                            <a href=\"#\" class=\"active\">" + (startingPage + 1) + "</a>\n" +
                        "                        </div>\n" +
                        "                        <div class=\"btn-next\">\n" +
                        "                            <a onclick='myProjectTable_next_1()'>Next<i class=\"fas fa-angle-double-right\"></i></a>\n" +
                        "                        </div>");
                }
            }
        });
    }
}

//前端分页查询数据 按地址 下一页
function myProjectTable_next_Address(w) {
    //县区编号
    var countryID = $("#Country option:selected").val();
    startingPage = startingPage + 1;
    var startingPageNumber = startingPage * number;
    var numberSum = $("#pageNumber").val();
    if (startingPageNumber >= numberSum && (startingPageNumber - number) <= numberSum) {
        Swal.fire("提示", "数据浏览已到底", "warning");
    } else {
        var data = {
            "page": startingPageNumber,
            "number": number,
            "countryID": countryID
        };
        $.ajax({
            url: "findCompanyByCompanyListAndCountryID",
            type: "POST",
            dataType: "json",
            data: JSON.stringify(data),
            contentType: 'application/json;charset=utf-8',
            success: function (data) {
                var code = ' ';
                if (data.code == 500) {
                    Swal.fire("提示", "温馨提示：查询此类数据不存在", "error");
                } else {
                    for (var i = 0; i < data.company_List.length; i++) {
                        code += "<div class=\"col-xl-4 col-md-6\">\n" +
                            "                                <div class=\"product-grid-view\">\n" +
                            "                                    <div class=\"grid-view-layout3\">\n" +
                            "                                        <div class=\"product-box-layout1 top-rated-grid\">\n" +
                            "                                            <div class=\"item-img\">\n" +
                            "                                                <a href=web-single-plaint.html?id=" + data.company_List[i].compID + " class=\"item-trending\"><img\n" +
                            "                                                    style='width: 275px;height: 195px;' src='upload/" + data.company_List[i].compPhoto + "'   alt=\"Product\"></a>\n" +
                            "                                                <div class=\"bg-color-price\">\n" +
                            "                                                </div>\n" +
                            "                                            </div>\n" +
                            "                                            <div class=\"item-content\">\n" +
                            "                                                <h3 class=\"item-title\"><a href=web-single-plaint.html?id=" + data.company_List[i].compID + ">" + data.company_List[i].compName + "\n" +
                            "                                                    </a><span>New</span></h3>\n" +
                            "                                                <ul class=\"entry-meta\">\n" +
                            "                                                    <li><i class=\"far fa-clock\"></i>" + data.company_List[i].compDate + "</li>\n" +
                            "                                                    <li><i class=\"fas fa-map-marker-alt\"></i>" + data.company_List[i].compAddress + "</li>\n" +
                            "                                                </ul>\n" +
                            "                                                <div class=\"item-action-area\">\n" +
                            "                                                    <div class=\"item-phone\">\n" +
                            "                                                         <a href=\"#\" class=\"classima-phone-reveal not-revealed\"\n" +
                            "                                                           data-phone=\"+886735568743\">\n" +
                            "                                                            <i class=\"fa fa-phone\"></i>\n" +
                            "                                                            <span class=\"number-hidden\">" + data.company_List[i].compPhone + "</span>\n" +
                            "                                                        </a>\n" +
                            "                                                    </div>\n" +
                            "                                                    <div class=\"item-fav\"><a href=\"#\"><i class=\"far fa-heart\"></i></a>\n" +
                            "                                                    </div>\n" +
                            "                                                </div>\n" +
                            "                                            </div>\n" +
                            "                                        </div>\n" +
                            "                                    </div>\n" +
                            "                                </div>\n" +
                            "                                <div class=\"product-list-view\">\n" +
                            "                                    <div class=\"list-view-layout3\">\n" +
                            "                                        <div class=\"product-box-layout3 top-rated-list\">\n" +
                            "                                            <div class=\"item-img\">\n" +
                            "                                                <a href=web-single-plaint.html?id=" + data.company_List[i].compID + " class=\"item-trending\"><img\n" +
                            "                                                     style='width: 275px;height: 195px;'   src='upload/" + data.company_List[i].compPhoto + "' alt=\"Product\"></a>\n" +
                            "                                            </div>\n" +
                            "                                            <div class=\"product-info\">\n" +
                            "                                                <div class=\"item-content\">\n" +
                            "                                                    <div class=\"bg-color-price\">\n" +
                            "                                                    </div>\n" +
                            "                                                    <div class=\"item-category\"><a href=web-single-plaint.html?id=" + data.company_List[i].compID + "></a></div>\n" +
                            "                                                    <h3 class=\"item-title\"><a href=web-single-plaint.html?id=" + data.company_List[i].compID + ">" + data.company_List[i].compName + "\n" +
                            "                                                        </a><span>New</span></h3>\n" +
                            "                                                    <ul class=\"entry-meta\">\n" +
                            "                                                        <li><i class=\"far fa-clock\"></i>" + data.company_List[i].compDate + "</li>\n" +
                            "                                                        <li><i class=\"fas fa-map-marker-alt\"></i>" + data.company_List[i].compAddress + "\n" +
                            "                                                        </li>\n" +
                            "                                                    </ul>\n" +
                            "                                                    <p>" + data.company_List[i].compProfile + ".</p>\n" +
                            "                                                </div>\n" +
                            "                                            </div>\n" +
                            "                                        </div>\n" +
                            "                                    </div>\n" +
                            "                                </div>\n" +
                            "                            </div>";

                    }
                    $("#loadWebList").html("");
                    $("#myProjectTable").html("");
                    $("#loadWebList").append(code);
                    $("#pageNumber").val(data.count);
                    $("#myProjectTable").html("   <div class=\"btn-prev\">\n" +
                        "                            <a onclick='myProjectTable_previous_1()'><i class=\"fas fa-angle-double-left\"></i>Previous</a>\n" +
                        "                        </div>\n" +
                        "                        <div class=\"page-number\">\n" +
                        "                            <a href=\"#\" class=\"active\">" + (startingPage + 1) + "</a>\n" +
                        "                        </div>\n" +
                        "                        <div class=\"btn-next\">\n" +
                        "                            <a onclick='myProjectTable_next_1()'>Next<i class=\"fas fa-angle-double-right\"></i></a>\n" +
                        "                        </div>");
                }
            }
        });
    }
}


$(function () {
    var DATA = '';
    $.ajax({
        url: "JudgeLogin_4",
        type: "POST",
        dataType: "json",
        contentType: 'application/json;charset=utf-8',
        success: function (data) {
            if (data.code == 500) {
                DATA += " <li class=\"header-btn\">\n" +
                    "                                    <a href=\"web-login.html\" class=\"item-btn\"><i class=\"fas fa-plus\"></i>登录</a>\n" +
                    "                                </li>"
            } else {
                DATA += " <li class=\"header-login-icon\">\n" +
                    "                                    <a href=\"web-account.html\" class=\"color-light\" data-toggle=\"tooltip\"\n" +
                    "                                       data-placement=\"top\" title=\"Login/Register\">\n" +
                    "                                        <i class=\"far fa-user\">我的</i>\n" +
                    "                                    </a>\n" +
                    "                                </li>\n" +
                    "                                <li class=\"header-btn\">\n" +
                    "                                    <a  onclick='tuichu()' class=\"item-btn\"><i class=\"fas fa-plus\"></i>退出</a>\n" +
                    "                                </li>"
            }
            $("#userData").html("");
            $("#userData").append(DATA);
        }
    });
    DoctorProvince();
    loadWebList();
});